package com.cms.utils;

import com.cms.common.BeanFactory;
import org.apache.commons.lang.StringUtils;
import org.springframework.core.env.Environment;

public class SpringUtils {


    public static String getContextPath(){
        Environment env = BeanFactory.getBean(Environment.class);
        String contextPath = env.getProperty("server.servlet.context-path");
        if(StringUtils.isBlank(contextPath)){
            return "";
        }
        return contextPath;
    }

}
